﻿using System;
using CSLua;
using Mono.Cecil;

namespace TK_CSLua.ILAnalyze
{
	// Token: 0x02000004 RID: 4
	public static class AnalyzeUtils
	{
		// Token: 0x06000006 RID: 6 RVA: 0x00002250 File Offset: 0x00000450
		public static bool checkBuildType(TypeDefinition typeDef)
		{
			if (typeDef.isSubTypeOf<Attribute>())
				return false;
			if (typeDef.IsInterface || (!typeDef.HasMethods && !typeDef.HasFields && !typeDef.HasProperties))
				return false;
			if (typeDef.hasAttributes(BuildConfig.skipAttributes))
				return false;
			if (BuildConfig.onlyTestAttribute != null && !typeDef.hasAttributes(BuildConfig.onlyTestAttribute))
				return false;
			return true;
		}

		// Token: 0x06000007 RID: 7 RVA: 0x000022C5 File Offset: 0x000004C5
		public static void Assert(bool b, string msg = null)
		{
			if (!b)
			{
				throw new Exception((msg != null) ? msg : "Assert fail!");
			}
		}
	}
}
